import 'dart:collection';

class HistoryMatchRecordModel {
  int? clubId;
  String? clubImage;
  String? clubName;
  String? courtName;
  String? isPunishment;
  String? jerseyColor;
  int? matchId;
  int? matchNumberParticipants;
  String? matchRulesName;
  String? matchRulesValue;
  String? matchTime;
  String? opponent;
  String? remark;
  List<SignUpUserVOS>? signUpUserVOS;
  String? siteFees;

  HistoryMatchRecordModel(
      {this.clubId,
      this.clubImage,
      this.clubName,
      this.courtName,
      this.isPunishment,
      this.jerseyColor,
      this.matchId,
      this.matchNumberParticipants,
      this.matchRulesName,
      this.matchRulesValue,
      this.matchTime,
      this.opponent,
      this.remark,
      this.signUpUserVOS,
      this.siteFees});

  HistoryMatchRecordModel.fromJson(Map<String, dynamic> json) {
    clubId = json['clubId'];
    clubImage = json['clubImage'];
    clubName = json['clubName'];
    courtName = json['courtName'];
    isPunishment = json['isPunishment'];
    jerseyColor = json['jerseyColor'];
    matchId = json['matchId'];
    matchNumberParticipants = json['matchNumberParticipants'];
    matchRulesName = json['matchRulesName'];
    matchRulesValue = json['matchRulesValue'];
    matchTime = json['matchTime'];
    opponent = json['opponent'];
    remark = json['remark'];
    if (json['signUpUserVOS'] != null) {
      signUpUserVOS = <SignUpUserVOS>[];
      json['signUpUserVOS'].forEach((v) {
        signUpUserVOS!.add( SignUpUserVOS.fromJson(v));
      });
    }
    siteFees = json['siteFees'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = HashMap();
    data['clubId'] = clubId;
    data['clubImage'] = clubImage;
    data['clubName'] = clubName;
    data['courtName'] = courtName;
    data['isPunishment'] = isPunishment;
    data['jerseyColor'] = jerseyColor;
    data['matchId'] = matchId;
    data['matchNumberParticipants'] = matchNumberParticipants;
    data['matchRulesName'] = matchRulesName;
    data['matchRulesValue'] = matchRulesValue;
    data['matchTime'] = matchTime;
    data['opponent'] = opponent;
    data['remark'] = remark;
    if (signUpUserVOS != null) {
      data['signUpUserVOS'] =
          signUpUserVOS!.map((v) => v.toJson()).toList();
    }
    data['siteFees'] = siteFees;
    return data;
  }
}

class SignUpUserVOS {
  List<GoodPosition>? goodPosition;
  int? grade;
  String? imgUrl;
  String? nickname;
  int? sex;
  int? userId;

  SignUpUserVOS(
      {this.goodPosition,
      this.grade,
      this.imgUrl,
      this.nickname,
      this.sex,
      this.userId});

  SignUpUserVOS.fromJson(Map<String, dynamic> json) {
    if (json['goodPosition'] != null) {
      goodPosition = <GoodPosition>[];
      json['goodPosition'].forEach((v) {
        goodPosition!.add( GoodPosition.fromJson(v));
      });
    }
    grade = json['grade'];
    imgUrl = json['imgUrl'];
    nickname = json['nickname'];
    sex = json['sex'];
    userId = json['userId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = HashMap();
    if (goodPosition != null) {
      data['goodPosition'] = goodPosition!.map((v) => v.toJson()).toList();
    }
    data['grade'] = grade;
    data['imgUrl'] = imgUrl;
    data['nickname'] = nickname;
    data['sex'] = sex;
    data['userId'] = userId;
    return data;
  }
}

class GoodPosition {
  String? positionSortCode;
  String? positionSortDescription;
  String? subdivisionPosition;
  String? subdivisionPositionCode;

  GoodPosition(
      {this.positionSortCode,
      this.positionSortDescription,
      this.subdivisionPosition,
      this.subdivisionPositionCode});

  GoodPosition.fromJson(Map<String, dynamic> json) {
    positionSortCode = json['positionSortCode'];
    positionSortDescription = json['positionSortDescription'];
    subdivisionPosition = json['subdivisionPosition'];
    subdivisionPositionCode = json['subdivisionPositionCode'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = HashMap();
    data['positionSortCode'] = positionSortCode;
    data['positionSortDescription'] = positionSortDescription;
    data['subdivisionPosition'] = subdivisionPosition;
    data['subdivisionPositionCode'] = subdivisionPositionCode;
    return data;
  }
}